package com.tuananh.radnom.model.userinfo;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.tuananh.radnom.model.AbstractConfiguration;
import com.tuananh.radnom.model.DirectoryConfig;

@XmlRootElement(name="user-conf")
@XmlType(propOrder = { "user", "group"})
public class UserConfiguration extends AbstractConfiguration {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6432856110745903029L;
	static ArrayList<User> users;
	static ArrayList<UserGroup> groups;

	public static String path = "../config/user-conf.xml";

	static {
		String temp = DirectoryConfig.configPaths.get(UserConfiguration.class
				.getName());
		if (temp != null)
			path = temp;
	}
	{
		configPath = path;
	}

	public ArrayList<User> getUser() {
		if (users==null) return new ArrayList<User>();
		return users;
	}

	public void setUser(ArrayList<User> users) {
		UserConfiguration.users = users;
	}

	public ArrayList<UserGroup> getGroup() {
		if (groups==null) return new ArrayList<UserGroup>();
		return groups;
	}

	public void setGroup(ArrayList<UserGroup> groups) {
		UserConfiguration.groups = groups;
	}

	public AbstractConfiguration clone() {
		// TODO Auto-generated method stub
		return null;
	}

}
